package com.dharma.mydiet.view;

import org.achartengine.ChartFactory;
import org.achartengine.GraphicalView;
import org.achartengine.model.CategorySeries;
import org.achartengine.model.TimeSeries;
import org.achartengine.model.XYMultipleSeriesDataset;
import org.achartengine.renderer.DefaultRenderer;
import org.achartengine.renderer.SimpleSeriesRenderer;
import org.achartengine.renderer.XYMultipleSeriesRenderer;
import org.achartengine.renderer.XYSeriesRenderer;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;

public class GraphicQuality {
    
    public GraphicalView getView(Context context, CategorySeries serie) {
	
	int colors [] = {Color.BLUE, Color.RED, Color.GREEN};
	
	DefaultRenderer renderer = new DefaultRenderer();
	
	for (int color:colors){
	    SimpleSeriesRenderer r= new SimpleSeriesRenderer();
	    r.setColor(color);
	    renderer.addSeriesRenderer(r);
	}
	return ChartFactory.getPieChartView(context, serie, renderer);
    }
}
